#define _CRT_SECURE_NO_WARNINGS
int lengthOfLastWord(char* s) {
    int len = strlen(s);
    int count = 0;
    while (s[len - 1] == ' ')
    {
        len--;
    }
    while (len && s[len - 1] != ' ')
    {
        len--;
        count++;
    }
    return count;
}